package cn.blog.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import cn.blog.feign.UserClient;
import cn.triedblog.dto.SystemUserLogin;

@Service
public class UserDetailServiceImpl implements UserDetailsService {

	@Autowired
	private UserClient userClient;

	@Override
	public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
		System.out.println("数据库获取");
		SystemUserLogin loginUser = userClient.findByUsername(username);
		System.out.println(loginUser);
		return loginUser;
	}

}